/*
 * Copyright (c) 1999-2003, Carnegie Mellon University. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * 3. Products derived from the software may not be called "iVProg",
 *    nor may "iVProg" appear in their name, without prior written
 *    permission of Carnegie Mellon University.
 *
 * 4. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *    "This product includes software developed by Carnegie Mellon University"
 */

package edu.cmu.cs.stage3.alice.core;

import edu.cmu.cs.stage3.alice.core.property.ObjectProperty;

public class RenderTarget extends Element {
	/** @deprecated */
	//Rem @Deprecated
	public final ObjectProperty requiredCapabilities = new ObjectProperty( this, "requiredCapabilities", null, Long.class );
	private java.awt.Component m_awtComponent;
	private static java.util.Dictionary s_componentMap = new java.util.Hashtable();
	public RenderTarget() {
		requiredCapabilities.deprecate();
	}
	//Rem @Override
	protected void finalize() throws java.lang.Throwable {
		if( m_awtComponent!=null ) {
			s_componentMap.remove( m_awtComponent );
		}
		super.finalize();
	}
	//Rem @Override
	protected void internalRelease( int pass ) {
	}

	public void addKeyListener( java.awt.event.KeyListener keyListener ) {
		if( m_awtComponent!=null ) {
			m_awtComponent.addKeyListener( keyListener );
		} else {
			throw new NullPointerException( "internal m_awtComponent is null" );
		}
	}
	public void removeKeyListener( java.awt.event.KeyListener keyListener ) {
		if( m_awtComponent!=null ) {
			m_awtComponent.removeKeyListener( keyListener );
		} else {
			throw new NullPointerException( "internal m_awtComponent is null" );
		}
	}
	public void addMouseListener( java.awt.event.MouseListener mouseListener ) {
		if( m_awtComponent!=null ) {
			m_awtComponent.addMouseListener( mouseListener );
		} else {
			throw new NullPointerException( "internal m_awtComponent is null" );
		}
	}
	public void removeMouseListener( java.awt.event.MouseListener mouseListener ) {
		if( m_awtComponent!=null ) {
			m_awtComponent.removeMouseListener( mouseListener );
		} else {
			throw new NullPointerException( "internal m_awtComponent is null" );
		}
	}
	public void addMouseMotionListener( java.awt.event.MouseMotionListener mouseMotionListener ) {
		if( m_awtComponent!=null ) {
			m_awtComponent.addMouseMotionListener( mouseMotionListener );
		} else {
			throw new NullPointerException( "internal m_awtComponent is null" );
		}
	}
	public void removeMouseMotionListener( java.awt.event.MouseMotionListener mouseMotionListener ) {
		if( m_awtComponent!=null ) {
			m_awtComponent.removeMouseMotionListener( mouseMotionListener );
		} else {
			throw new NullPointerException( "internal m_awtComponent is null" );
		}
	}

	//Rem @Override
	protected void started( World world, double time ) {
	}
	//Rem @Override
	protected void stopped( World world, double time ) {
	}
}
